package com.jianzong.lingxuan.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @auth Leiwenlong
 * @since 2021/11/6
 *  消费者
 */
@Component
@RabbitListener(queues = "testQuery")
@Slf4j
public class RabbitConsumer {

    //异步执行任务
    @RabbitHandler
    public void task(String message){
        log.info("获取消息->"+message);
    }
}
